\(\int \sec ^2(e+f x) (a+b \sec ^2(e+f x)) \, dx\) [160]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 43 \[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {(3 a+2 b) \tan (e+f x)}{3 f}+\frac {b \sec ^2(e+f x) \tan (e+f x)}{3 f} \]

[Out]

1/3*(3*a+2*b)*tan(f*x+e)/f+1/3*b*sec(f*x+e)^2*tan(f*x+e)/f

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4131, 3852, 8} \[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {(3 a+2 b) \tan (e+f x)}{3 f}+\frac {b \tan (e+f x) \sec ^2(e+f x)}{3 f} \]

[In]

Int[Sec[e + f*x]^2*(a + b*Sec[e + f*x]^2),x]

[Out]

((3*a + 2*b)*Tan[e + f*x])/(3*f) + (b*Sec[e + f*x]^2*Tan[e + f*x])/(3*f)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 4131

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) + (A_)), x_Symbol] :> Simp[(-C)*Cot
[e + f*x]*((b*Csc[e + f*x])^m/(f*(m + 1))), x] + Dist[(C*m + A*(m + 1))/(m + 1), Int[(b*Csc[e + f*x])^m, x], x
] /; FreeQ[{b, e, f, A, C, m}, x] && NeQ[C*m + A*(m + 1), 0] &&  !LeQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {b \sec ^2(e+f x) \tan (e+f x)}{3 f}+\frac {1}{3} (3 a+2 b) \int \sec ^2(e+f x) \, dx \\ & = \frac {b \sec ^2(e+f x) \tan (e+f x)}{3 f}-\frac {(3 a+2 b) \text {Subst}(\int 1 \, dx,x,-\tan (e+f x))}{3 f} \\ & = \frac {(3 a+2 b) \tan (e+f x)}{3 f}+\frac {b \sec ^2(e+f x) \tan (e+f x)}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.84 \[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {a \tan (e+f x)}{f}+\frac {b \left (\tan (e+f x)+\frac {1}{3} \tan ^3(e+f x)\right )}{f} \]

[In]

Integrate[Sec[e + f*x]^2*(a + b*Sec[e + f*x]^2),x]

[Out]

(a*Tan[e + f*x])/f + (b*(Tan[e + f*x] + Tan[e + f*x]^3/3))/f

Maple [A] (verified)

Time = 0.37 (sec) , antiderivative size = 35, normalized size of antiderivative = 0.81

method result size
derivativedivides \(\frac {a \tan \left (f x +e \right )-b \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}\) \(35\)
default \(\frac {a \tan \left (f x +e \right )-b \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}\) \(35\)
parts \(\frac {a \tan \left (f x +e \right )}{f}-\frac {b \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}\) \(37\)
parallelrisch \(\frac {\left (3 a +2 b \right ) \sin \left (3 f x +3 e \right )+3 \sin \left (f x +e \right ) \left (a +2 b \right )}{3 f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) \(57\)
risch \(\frac {2 i \left (3 a \,{\mathrm e}^{4 i \left (f x +e \right )}+6 a \,{\mathrm e}^{2 i \left (f x +e \right )}+6 b \,{\mathrm e}^{2 i \left (f x +e \right )}+3 a +2 b \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) \(63\)
norman \(\frac {-\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}-\frac {2 \left (a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{f}+\frac {4 \left (3 a +b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3}}\) \(75\)

[In]

int(sec(f*x+e)^2*(a+b*sec(f*x+e)^2),x,method=_RETURNVERBOSE)

[Out]

1/f*(a*tan(f*x+e)-b*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e))

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.86 \[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {{\left ({\left (3 \, a + 2 \, b\right )} \cos \left (f x + e\right )^{2} + b\right )} \sin \left (f x + e\right )}{3 \, f \cos \left (f x + e\right )^{3}} \]

[In]

integrate(sec(f*x+e)^2*(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

1/3*((3*a + 2*b)*cos(f*x + e)^2 + b)*sin(f*x + e)/(f*cos(f*x + e)^3)

Sympy [F]

\[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right ) \sec ^{2}{\left (e + f x \right )}\, dx \]

[In]

integrate(sec(f*x+e)**2*(a+b*sec(f*x+e)**2),x)

[Out]

Integral((a + b*sec(e + f*x)**2)*sec(e + f*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.79 \[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {{\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} b + 3 \, a \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate(sec(f*x+e)^2*(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

1/3*((tan(f*x + e)^3 + 3*tan(f*x + e))*b + 3*a*tan(f*x + e))/f

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.79 \[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {b \tan \left (f x + e\right )^{3} + 3 \, a \tan \left (f x + e\right ) + 3 \, b \tan \left (f x + e\right )}{3 \, f} \]

[In]

integrate(sec(f*x+e)^2*(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

1/3*(b*tan(f*x + e)^3 + 3*a*tan(f*x + e) + 3*b*tan(f*x + e))/f

Mupad [B] (verification not implemented)

Time = 17.96 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.65 \[ \int \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right ) \, dx=\frac {b\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a+b\right )}{f} \]

[In]

int((a + b/cos(e + f*x)^2)/cos(e + f*x)^2,x)

[Out]

(b*tan(e + f*x)^3)/(3*f) + (tan(e + f*x)*(a + b))/f